Private inputs example + dapp quickstart doc#87
Open
iamalwaysuncomfortable wants to merge 21 commits into
Open
Private inputs example + dapp quickstart doc#87iamalwaysuncomfortable wants to merge 21 commits into
iamalwaysuncomfortable wants to merge 21 commits into
Conversation
Update InputRequest type to include new request kinds and clarify wallet behavior. Revise permission model and fulfillment flow for better user input handling. Signed-off-by: Mike Turner <mike@provable.com>
Signed-off-by: Mike Turner <mike@provable.com>
Rename `kind` to `type` and `RecordMatcher` to `RecordFieldFilter`. Reframe the permission model as additive: `programs` and `decryptPermission` are preserved exactly, with `recordAccess` and `viewKeyExposure` as new opt-in fields. Drop `anyProgram` level. Document backward-compatibility guarantees, interaction rules, and validation failure modes.
Make readAddress optional with default true. Add an Address exposure subsection covering all four address-leakage surfaces (connect return, _publicKey getter, init handler, plaintext-bearing methods) and their behavior under readAddress: false. Document the decryptPermission: NoDecrypt-only constraint and the deliberate signMessage leak.
Adds the dapp-facing types and signature changes from docs/adapter-privacy-extension.md. aleo-types: new InputRequest, RecordFilters, RecordFieldFilter, TransactionInput types with isLiteralInput / hasInputRequest helpers. TransactionOptions.inputs widens from string[] to TransactionInput[]. aleo-wallet-standard: new ConnectOptions, RecordAccessGrant, ProgramGrant, RecordGrant, FieldGrant (with readAccess), ViewKeyExposure, plus a hasUnsupportedConnectOptions helper. ConnectFeature.connect and WalletAdapterProps.connect accept an optional fourth options argument. aleo-wallet-adaptor/core: BaseAleoWalletAdapter.connect accepts options, enforces the readAddress: false / decryptPermission: NoDecrypt precondition, tracks _readAddress, and short-circuits decrypt, requestRecords, transitionViewKeys, requestTransactionHistory under address withholding. New error classes: WalletInputRequestNotSupportedError, WalletConnectOptionsNotSupportedError, WalletAddressWithheldError. The new types are re-exported from core for dapp ergonomics. Wallet adapters: leo, fox, soter, puzzle widen connect with options? and throw WalletConnectOptionsNotSupportedError when any of the new options are set; their executeTransaction throws WalletInputRequestNotSupportedError when any input is an InputRequest. Shield forwards options to the extension and tolerates an empty address under readAddress: false. react: AleoWalletProvider accepts new optional props recordAccess, viewKeyExposure, readAddress and forwards them on every adapter.connect call. Dependency arrays updated. Doc: clarified that Account.address returns "" (empty string) under readAddress: false rather than null, and that FieldGrant.readAccess controls plaintext exposure independently of filterability.
Implement wallet-specified record inputs and address permission grants
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
15 tasks
Drops the type: "viewKey" InputRequest variant and the viewKeyExposure ConnectOptions field across the type packages, wallet adapter, React provider, example app, docs, and changeset. The separate transitionViewKeys feature is unrelated and unchanged.
…lues
Adds a fourth `InputRequest` variant `{ type: "derived", algorithm, args }`
that asks the wallet to run a named cryptographic algorithm over its own
state (view key, wallet-maintained counters, etc.) plus dapp-supplied args,
and substitutes the result into a transaction input slot. The dapp never
observes the wallet-side inputs — only the output.
Strict opt-in via a new `algorithmsAllowed?: AlgorithmGrant[]` field on
`ConnectOptions`: each grant authorizes exactly one
`(algorithm, program, function, inputPosition)` call site, all four fields
required and exact-match. The wallet refuses every derived request whose
tuple is not present. No broad default.
A new `algorithmsSupported(): Promise<string[]>` adapter method lets dapps
discover what a wallet implements before populating the allowlist.
Wallets without derived-input support return `[]` (default) and connections
with non-empty `algorithmsAllowed` throw `WalletConnectOptionsNotSupportedError`
via the existing `hasUnsupportedConnectOptions` path.
Inaugural algorithm: `program-scoped-address-blind`. Inputs: `{ "domain-separator": field }`.
Output: `address`. Valid slot positions: `address`, `group`, `scalar`, `field`.
Updates the PrivateInputs example with a fourth `Derived` mode on primitive
slots whose baseType is in an algorithm's `validSlotTypes`, plus a
connect-time `AlgorithmGrant[]` editor with an "Auto-grant this function's
eligible slots" convenience button. The grant JSON preview now includes
`algorithmsAllowed`.
See docs/adapter-privacy-extension.md §"Derived inputs" for the spec and
docs/dapp-privacy-quickstart.md for an implementor's guide.
Derived inputs: wallet-computed cryptographic values
emmaprice082
left a comment
Collaborator
There was a problem hiding this comment.
Changes to support DEX will be applied to this PR from @iamalwaysuncomfortable as per this slack conversation: https://provablehq.slack.com/archives/C09BJ3FRADU/p1779990449495799
…ved-input form buildInputs now omits blank optional args (so issue-mode works without a targetAddress) and the arg form renders possibleValues (e.g. mode) as a select instead of a free-text field with a misleading numeric-literal placeholder.
…olve-mode claim example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a Private Inputs demo under
examples/react-app/src/components/functions/PrivateInputs.tsxexercising the spec's new wallet-adapter privacy features end-to-end:recordAccessgrants (program / record / field narrowing) composed via a structured form, with a JSON preview for copy-paste into a real dapp.readAddressandviewKeyExposuretoggles, including thereadAddress: false↔decryptPermission: NoDecryptinterlock.{type:"address"}, or{type:"viewKey"}(allowed per spec foraddress/group/scalar/field).uidfrom a fetched-records dropdown, or auto-select byRecordFilters.recordView.fieldssurvive per the configured grant).Docs
Concise dapp-implementor guide for these features:
dapp-privacy-quickstart.md
Type of Change
Testing
pnpm --filter react-app-example buildsucceeds.pnpm lintclean.recordAccessgrant, apply + reconnect, fetch records (verified envelope-metadata stripping matches the spec's matrix), executecredits.aleo/transfer_privatevia bothuidpinning andRecordFilters, verify thereadAddress: falseinterlock againstdecryptPermission.